THashSet< T > Class Template Reference
[Template Containers]

A hash set is a collection of items, without any particular order and without repetitions stored in a hash table. More...

#include <thashset.h>

Inheritance diagram for THashSet< T >:
Inheritance graph
[legend]

Public Types

typedef uint32(* THashFunc )(const T &, uint32)
 Hash function type.

Public Member Functions

 THashSet (int32=10)
 Default constructor, size = number of buckets.
 THashSet (THashFunc, int32=10)
 Constructor with hash function, size = number of buckets.
 THashSet (const THashSet< T > &)
 Copy constructor - uses copy, copy used add.
 THashSet (THashFunc, const TContainer< T > &)
 Container with hash function and container to copy.
 ~THashSet ()
 Destructor.
THashSet< T > & operator= (const THashTable< T > &)
 Assignment operator, uses copy.
THashSet< T > operator- (const THashSet< T > &) const
 Difference operator.
THashSet< T > operator& (const THashSet< T > &) const
 Intersection operator.
THashSet< T > operator| (const THashSet< T > &) const
 Union operator.
bool add (const T &)
 Add item to set if not already contained.

Detailed Description

template<class T>
class Steinberg::THashSet< T >

A hash set is a collection of items, without any particular order and without repetitions stored in a hash table.

A hash table stores its items in hash buckets whose pointers are stored in an array at the index given by the hash function, which is a integer function of the item. The buckets are necessary to hold all items with the same hash index.

See also:
THashTable

Member Typedef Documentation

typedef uint32(* THashFunc)(const T &, uint32)

Hash function type.

Reimplemented from THashTable< T >.


Constructor & Destructor Documentation

THashSet ( int32  size = 10  )  [inline]

Default constructor, size = number of buckets.

Parameters:
[in] size Number of buckets in the new hash set.
THashSet ( THashFunc  func,
int32  size = 10 
) [inline]

Constructor with hash function, size = number of buckets.

Parameters:
[in] func Hash function the hash set uses.
[in] size Number of buckets in the new hash set
THashSet ( const THashSet< T > &  set  )  [inline]

Copy constructor - uses copy, copy used add.

Parameters:
[in] set Hash set to copy.
THashSet ( THashFunc  func,
const TContainer< T > &  cont 
) [inline]

Container with hash function and container to copy.

Parameters:
[in] func Hash function the set uses.
[in] cont Container to construct the table from.
~THashSet (  )  [inline]

Destructor.


Member Function Documentation

THashSet< T > & operator= ( const THashTable< T > &  table  )  [inline]

Assignment operator, uses copy.

Parameters:
[in] table Assign input set or table to this set.
Returns:
Assigned hash set reference.
THashSet< T > operator- ( const THashSet< T > &  set  )  const [inline]

Difference operator.

Parameters:
[in] set Contains items to be subtracted.
Returns:
Hash set containing those items appearing in this set that have no equal in the specified set.
THashSet< T > operator& ( const THashSet< T > &  set  )  const [inline]

Intersection operator.

Parameters:
[in] set Contains items to be intersected.
Returns:
Hash set containing those items appearing in this set and the input set.
THashSet< T > operator| ( const THashSet< T > &  set  )  const [inline]

Union operator.

Parameters:
[in] set Contains items to be united.
Returns:
Hash set containing those items appearing in this set or the input set.
bool add ( const T &  item  )  [inline, virtual]

Add item to set if not already contained.

Parameters:
[in] item Item that will be added if no similar item is already contained by the set.

Reimplemented from THashTable< T >.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Empty

Copyright ©2013 Steinberg Media Technologies GmbH. All Rights Reserved.